package com.hxc.web.controller.interest;

import java.util.List;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.hxc.common.annotation.Log;
import com.hxc.common.core.controller.BaseController;
import com.hxc.common.core.domain.AjaxResult;
import com.hxc.common.enums.BusinessType;
import com.hxc.interest.domain.TReactionCareof;
import com.hxc.interest.service.ITReactionCareofService;
import com.hxc.common.utils.poi.ExcelUtil;
import com.hxc.common.core.page.TableDataInfo;

/**
 * 反馈处理转交Controller
 * 
 * @author hxc
 * @date 2021-08-27
 */
@Api(tags = "反馈转交处理管理")
@RestController
@RequestMapping("/interest/careof")
public class TReactionCareofController extends BaseController
{
    @Autowired
    private ITReactionCareofService tReactionCareofService;

    /**
     * 查询反馈处理转交列表
     */
    @ApiOperation(value = "反馈转交列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "careofId", value = "转交人id",dataType = "Integer"),
            @ApiImplicitParam(name = "conductorId", value = "处理人id",dataType = "Integer"),
            @ApiImplicitParam(name = "reactionId", value = "反馈事件id",dataType = "Integer"),
            @ApiImplicitParam(name = "careStatus", value = "转交状态（0：默认无，1：同意，2：拒绝）",dataType = "Integer"),
            @ApiImplicitParam(name = "isView", value = "是否查看（0：否，1：是）",dataType = "Integer")
    })
    @GetMapping("/list")
    public TableDataInfo list(TReactionCareof tReactionCareof)
    {
        startPage();
        List<TReactionCareof> list = tReactionCareofService.selectTReactionCareofList(tReactionCareof);
        return getDataTable(list);
    }

    /**
     * 导出反馈处理转交列表
     */
    @Log(title = "反馈处理转交", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(TReactionCareof tReactionCareof)
    {
        List<TReactionCareof> list = tReactionCareofService.selectTReactionCareofList(tReactionCareof);
        ExcelUtil<TReactionCareof> util = new ExcelUtil<TReactionCareof>(TReactionCareof.class);
        return util.exportExcel(list, "反馈处理转交数据");
    }

    /**
     * 获取反馈处理转交详细信息
     */
    @ApiOperation(value = "转交处理详情")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(tReactionCareofService.selectTReactionCareofById(id));
    }

    /**
     * 新增反馈处理转交
     */
    @ApiOperation(value = "新增反馈转交")
    @Log(title = "反馈处理转交", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody TReactionCareof tReactionCareof)
    {
        return toAjax(tReactionCareofService.insertTReactionCareof(tReactionCareof));
    }

    /**
     * 修改反馈处理转交
     */
    @ApiOperation(value = "修改反馈转交")
    @Log(title = "反馈处理转交", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody TReactionCareof tReactionCareof)
    {
        return toAjax(tReactionCareofService.updateTReactionCareof(tReactionCareof));
    }

    /**
     * 删除反馈处理转交
     */
    @Log(title = "反馈处理转交", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(tReactionCareofService.deleteTReactionCareofByIds(ids));
    }

}
